﻿<Application x:Class="FM.录音.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:valueConverter="clr-namespace:NJT.ValueConverter;assembly=NJT">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/FM.素材;component/图标.xaml" />
                <ResourceDictionary Source="/FM.素材;component/颜色.xaml" />
                <ResourceDictionary Source="/Themes/Generic.xaml" />
            </ResourceDictionary.MergedDictionaries>


            <valueConverter:Bool真隐藏 x:Key="Bool真隐藏" />
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />



            <SolidColorBrush x:Key="画笔开" Color="#FF62F062" />
            <SolidColorBrush x:Key="画笔关" Color="#FF8E8F8E" />

            <Style x:Key="开关样式" TargetType="{x:Type CheckBox}">
                <Setter Property="Margin" Value="2" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type CheckBox}">
                            <DockPanel Width="Auto"
                                       HorizontalAlignment="Stretch"
                                       VerticalAlignment="Top"
                                       LastChildFill="True">

                                <ContentPresenter Height="Auto"
                                                  HorizontalAlignment="Left"
                                                  Content="{TemplateBinding Content}"
                                                  RecognizesAccessKey="True" />
                                <Grid Visibility="{TemplateBinding IsChecked, Converter={StaticResource Bool真隐藏}}">
                                    <Border Width="60"
                                            Background="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
                                            BorderBrush="{DynamicResource 画笔关}"
                                            BorderThickness="2"
                                            CornerRadius="4" />
                                    <Border Width="25"
                                            HorizontalAlignment="Right"
                                            Background="{DynamicResource 画笔关}"
                                            BorderThickness="2"
                                            CornerRadius="4" />

                                    <TextBlock Margin="2"
                                               HorizontalAlignment="Left"
                                               VerticalAlignment="Center"
                                               Text="关" />

                                </Grid>
                                <Grid Visibility="{TemplateBinding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
                                    <Border Width="60"
                                            Background="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
                                            BorderBrush="{DynamicResource 画笔开}"
                                            BorderThickness="2"
                                            CornerRadius="4" />
                                    <Border Width="25"
                                            HorizontalAlignment="Left"
                                            Background="{DynamicResource 画笔开}"
                                            BorderThickness="2"
                                            CornerRadius="4" />
                                    <TextBlock Margin="2"
                                               HorizontalAlignment="Right"
                                               VerticalAlignment="Center"
                                               Text="开" />
                                </Grid>
                            </DockPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


        </ResourceDictionary>
    </Application.Resources>
</Application>
